﻿CREATE TABLE DBBackOffice.DBInventoryEntry (
	ID							uniqueidentifier PRIMARY KEY,				/* Unique GUID for this inventory entry */
	DBInventoryID				uniqueidentifier NOT NULL,					/* is under this iventory */
	FOREIGN KEY (DBInventoryID) REFERENCES DBBackOffice.DBInventory(ID) ON DELETE CASCADE,
	DBInstrumentStaticDataID	uniqueidentifier NOT NULL,					/* On instrument with such ID */
	QuantityBuy					integer NOT NULL CHECK (QuantityBuy>0),		/* Quantity Bought */
	AvgPriceBuy					float NOT NULL CHECK (AvgPriceBuy>0),		/* At this average price */
	QuantitySell				integer NOT NULL CHECK (QuantitySell>0),	/* Quantity Sold */
	AvgPriceSell				float NOT NULL CHECK (AvgPriceSell>0),		/* At this average price */
);